﻿using System.Text.Json.Serialization;
using Simple.Repository.Models.ClassRoom;

namespace Simple.Services;

public class GardenHuoseOutputModel : ModelBase
{
    /// <summary>
    /// 园所信息Id
    /// </summary>
    public Guid? Id { get; set; } = null;

    /// <summary>
    /// 园所名称
    /// </summary>
    [Required(ErrorMessage = "园所名称是必输的")]
    public string? GardenName { get; set; }

    /// <summary>
    /// 成立时间
    /// </summary>
    public DateTime? DateofEstablishment { get; set; }

    /// <summary>
    /// 省份值
    /// </summary>
    public string? ProvinceValue { get; set; } = "";

    /// <summary>
    /// 省份名称
    /// </summary>
    [Required(ErrorMessage = "省份名称是必输的")]
    public string? ProvinceName { get; set; }

    /// <summary>
    /// 城市值
    /// </summary>
    public string? CityValue { get; set; } = "";

    /// <summary>
    /// 城市名称
    /// </summary>
    [Required(ErrorMessage = "城市名称是必输的")]
    public string? CityName { get; set; }

    /// <summary>
    /// 区县名称
    /// </summary>
    [Required(ErrorMessage = "区县值是必输的")]
    public string? AreaName { get; set; }

    /// <summary>
    /// 街道名称
    /// </summary>
/*    [Required(ErrorMessage = "街道名称是必输的")]*/
    public string? StreetName { get; set; }

    /// <summary>
    /// 幼儿园类型（1-公立，2-私立）
    /// </summary>
    [Required(ErrorMessage = "幼儿园类型是必输的")]
    public int GardenType { get; set; }

    /// <summary>
    /// 是否普惠园
    /// </summary>
    [Required(ErrorMessage = "是否普惠园是必输的")]
    public bool WhetherItIsPuhuiPark { get; set; }

    /// <summary>
    /// 园所级别 参考 GardenLevelType 对象
    /// </summary>
    public int? GardenLevel { get; set; } = 0;

    /// <summary>
    /// 占地面积
    /// </summary>
    public double? AreaCovered { get; set; } = 0.0;

    /// <summary>
    /// 园所Logo
    /// </summary>
    public string? GardenLogo { get; set; } = "";

    /// <summary>
    /// 园所介绍信息
    /// </summary>
    public string? Desc { get; set; } = "";

    public override void ConfigureMapper(Profile profile)
    {
        profile.CreateMap<GardenHouseInfo, GardenHuoseOutputModel>();

        profile.CreateMap<GardenHuoseOutputModel, GardenHouseInfo>();
    }
}

public class GardenHuoseQrCodeImageModel
{
    /// <summary>
    /// 内容
    /// </summary>
    public string Content { get; set; }

    /// <summary>
    /// 二维码宽度
    /// </summary>
    public int With { get; set; }

    /// <summary>
    /// 二维码高度
    /// </summary>
    public int Height { get; set; }
}

public class ProvinceCityDto
{
    [Newtonsoft.Json.JsonProperty("provinceCity")]
    public List<ProvinceDto> ProvinceCity { get; set; }
}

public class ProvinceDto
{
    /// <summary>
    /// 编码
    /// </summary>
    [Newtonsoft.Json.JsonProperty("code")]
    public string Code { get; set; }

    /// <summary>
    /// 名称
    /// </summary>
    [Newtonsoft.Json.JsonProperty("name")]
    public string Name { get; set; }

    /// <summary>
    /// 子节点
    /// </summary>
    [Newtonsoft.Json.JsonProperty("children")]
    public List<ProvinceDto> Children { get; set; } = new List<ProvinceDto>();
}
